<div class="detail-user-frame">
    <div class="insc-form">
        <div class="onglet-pls">
            <div class="input-btn1">
                <!--input type="submit" class="button-input" placeholder="Submit" required /-->
                <button class="button-input1 button-onglet" onclick="openTab(event, 'ajouter')">Ajouter une categorie</button>
            </div>
            <!--h1 class="text-center">Inscription</h1-->
            <div class="input-btn1">
                <!--input type="submit" class="button-input" placeholder="Submit" required /-->
                <button class="button-input1 button-onglet" onclick="openTab(event, 'voir')">Voir les categories</button>
            </div>
        </div>
        <div id="ajouter" class="insert-place">
            <?php require_once ("vue/vue_insert_categories.php");?>
        </div>
        <?php
        if (isset($_POST['Submit'])) {
            $unControleur->insertCategorie ($_POST); 
        }//else{echo 'not user';}
        $laCategorie = null;

        if (isset($_POST['Filtrer'])) {
            $nom_categorie=$_POST['nom_categorie'];
            $desc_categorie=$_POST['desc_categorie'];
            $ref_categorie=$_POST['ref_categorie'];
            /*$sexe_user=$_POST['sexe_user'];
            $numtel_user=$_POST['numtel_user'];
            $pseudo_user=$_POST['pseudo_user'];
            $email_user=$_POST['email_user'];
            $statut_user=$_POST['statut_user'];*/
    
        
            $lesCategories = $unControleur->searchAllCategories($nom_categorie, $desc_categorie, $ref_categorie);
        } else {
            $lesCategories = $unControleur->selectAllCategories();
        }
        ?>
        <div id="voir" class="insert-place">
            <?php require_once ("vue/vue_all_categories.php");?>
        </div>
    </div>
</div>

<!--h2> Gestion des classes </h2-->

<!--?php
if(isset($data['statut_user']) && $data['statut_user'] == "Admin"){
		//gestion admin 
		$laCategorie = null; //classe à modifier 
    if (isset($_POST['Submit'])) {
        $nom_categorie=$_POST['nom_categorie'];
        $img_categorie=$_POST['img_categorie'];
        $desc_categorie=$_POST['desc_categorie'];
        $ref_categorie=$_POST['ref_categorie'];
        

        


        echo $nom_categorie . '<br>';
        echo $img_categorie . '<br>';
        echo $desc_categorie . '<br>';
        echo $ref_categorie . '<br>';
        //$lesCategories = $unControleur->searchAllCategories($nom_user, $prenom_user, $datenaissance_user, $sexe_user, $numtel_user, $pseudo_user, $email_user, $statut_user);
    } else {
        $lesCategories = $unControleur->selectAllCategories();
    }
    
	require_once ("vue/vue_insert_categories.php");
}
?-->

<!--?php
if (isset($_SESSION['email']) && isset($_SESSION['role'])  && $_SESSION['role'] == "admin"){
		//gestion admin 
		$laClasse = null; //classe à modifier 

		if (isset($_GET['action']) && isset($_GET['idclasse']))
		{
			$action = $_GET['action']; 
			$idclasse = $_GET['idclasse']; 

			switch($action)
			{
				case "sup" : $unControleur->deleteClasse($idclasse) ; break;
				case "edit" : 
				$laClasse = $unControleur->selectWhereClasse ($idclasse);
				//var_dump($laClasse);
				break; 
			}
		}
		require_once ("vue/vue_insert_classe.php");

		if (isset($_POST['Valider']))
		{
			$unControleur->insertClasse ($_POST); 
		}

		if (isset($_POST['Modifier']))
		{
			$unControleur->updateClasse ($_POST); 
			header("Location: index.php?page=2");
		}
 	}// fin de la gestion admin 
	
	if (isset($_POST['Filtrer']))
	{
		$filtre = $_POST['filtre']; 
		$lesClasses = $unControleur->searchAllClasses($filtre);
		//echo $filtre;
	}else {

		$lesClasses = $unControleur->selectAllClasses (); 
	}
	require_once ("vue/vue_select_classes.php");
?-->